<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'news-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note"><?php echo Yii::t('common', 'Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'active'); ?>
		<?php echo $form->dropDownList($model,'active', array('0'=>Yii::t('common','inactive'),'1'=>Yii::t('common','active'))); ?>
		<?php echo $form->error($model,'active'); ?>
	</div>

	<?php

	$tabs = array();
	$errors = array_keys($model->getErrors());

	$languages = Languages::model()->getLanguages();	
	foreach ($languages as $lang)
	{
		$errorTab = false;
		foreach ($errors as $error)
			if (substr($error,-3) == '_'.$lang['code'])
				$errorTab = true;
		$tabs[$lang['name']] = array(
			'content' => $this->renderPartial('_el_form', array('model'=>$model, 'lang'=>$lang['code'], 'form'=>$form), true),
			'id' => $lang['code'],
			'error' => $errorTab,
			);
	}
	$this->widget('application.extensions.MyCJuiTabs', array(
		'tabs' => $tabs,
		// additional javascript options for the tabs plugin
		'options'=>array(
//			'collapsible'=>true,
		),
		'htmlOptions'=>array('class'=>'shadowtabs'),
	));
	?>
	
	
	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? tt('Create') : tt('Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->